<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //原数组不变
        //indexOf和lastIndexOf:检测当前项在数组中第一次或最后一次出现的位置索引
        //如果数组中没有这一项，返回-1
        let a = [1, 3, 5, 3, 7, 9]

        if (a.indexOf(1) === -1) {
            //不包含
        }
    </script>
</body>

</html>